/**
 * Generate code from /{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@NONE}}.java.hbs
 */
package cn.ibizlab.core.system.domain;

import java.util.*;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.*;
import org.springframework.data.annotation.*;
import cn.ibizlab.util.annotation.*;
import cn.ibizlab.util.enums.*;
import cn.ibizlab.util.domain.IEntity;
import cn.ibizlab.util.domain.EntityBase;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.Accessors;
import io.swagger.annotations.*;
import cn.ibizlab.core.system.domain.SysMenu;
import cn.ibizlab.core.system.domain.SysComponent;
import cn.ibizlab.core.system.domain.SysPermission;

/**
 * 菜单功能实体类[SysMenuFunc]
 *
 * @author generator
 */
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(value = "handler")
@ApiModel(value = "SYS_MENU_FUNC", description = "菜单功能")
public class SysMenuFunc extends EntityBase implements Serializable
{

    /**
     * 菜单标识
     */
    @Id
    @DEField(name = "menu_id" , isKeyField = true)
    @JsonProperty("menu_id")
    @JSONField(name = "menu_id")
    @ApiModelProperty(value = "menu_id", notes = "菜单标识")
    private String menuId;

    /**
     * 组件标识
     */
    @DEField(name = "component_id")
    @JsonProperty("component_id")
    @JSONField(name = "component_id")
    @ApiModelProperty(value = "component_id", notes = "组件标识")
    private String componentId;

    /**
     * 组件显示名
     */
    @DEField(name = "display_name")
    @JsonProperty("display_name")
    @JSONField(name = "display_name")
    @ApiModelProperty(value = "display_name", notes = "组件显示名")
    private String displayName;

    /**
     * 系统菜单
     */
    @JSONField(name = "menu")
    @JsonProperty("menu")
    @ApiModelProperty(value = "menu", notes = "菜单")
    private SysMenu menu;

    /**
     * 组件
     */
    @JSONField(name = "component")
    @JsonProperty("component")
    @ApiModelProperty(value = "component", notes = "组件")
    private SysComponent component;


    /**
     * 复制当前对象数据到目标对象(粘贴重置)
     * @param targetEntity 目标数据对象
     * @param includeEmpty  是否包括空值
     * @param <T>
     * @return
     */
    @Override
    public <T> T pasteTo(T targetEntity, boolean includeEmpty) {
        super.pasteTo(targetEntity, includeEmpty);
        if(targetEntity instanceof IEntity) {
            IEntity entity = ((IEntity) targetEntity);
            entity.reset("menu_id");
        }
        return targetEntity;
    }

}